package com.niiwoo.civet.mobile.vo.response.invest;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by dell on 2017/12/7.
 */
@Data
@ToString
@ApiModel("投资订单详情")
public class InvestOrderDetailResponseVO {
	@ApiModelProperty("投资订单衍变状态（1投资中，2回款中，3回款逾期，4已关闭，5已结清）")
	private Byte evolutionStatus;
	@ApiModelProperty("期限类型：1月，2天")
	private Byte deadlineUnit;
	@ApiModelProperty("投资订单详情（投资中不为空）")
	private InvestingOrderDetailVO investingOrderDetailVO;
	@ApiModelProperty("月标投资订单详情（回款中||回款逾期）")
	private MonthProjectBackingOrderDetailVO monthProjectBackingOrderDetailVO;
	@ApiModelProperty("月标投资订单详情（已结清）")
	private MonthProjectBackedOrderDetailVO monthProjectBackedOrderDetailVO;
	@ApiModelProperty("天标投资订单详情（回款中||回款逾期）")
	private DayProjectBackingOrderDetailVO dayProjectBackingOrderDetailVO;
	@ApiModelProperty("天标投资订单详情（已结清）")
	private DayProjectBackedOrderDetailVO dayProjectBackedOrderDetailVO;

	@ApiModel("投资订单详情（投资中）")
	@Data
	@ToString
	public static class InvestingOrderDetailVO {
		@ApiModelProperty("投资金额")
		private BigDecimal amount;
		@ApiModelProperty("预期收益")
		private BigDecimal interest;
		@ApiModelProperty("已投资金额")
		private BigDecimal investedAmount;
		@ApiModelProperty("借款目标")
		private BigDecimal contractAmount;
		@ApiModelProperty("投标截止时间")
		private Date investEndTime;
		@ApiModelProperty("是否满标 0:未满标 1:满标")
		private Byte isFull;
		@ApiModelProperty("描述")
		private String desc;
	}

	@ApiModel("月标投资订单详情（回款中||回款逾期）")
	@Data
	@ToString
	public static class MonthProjectBackingOrderDetailVO {
		@ApiModelProperty("待收金额")
		private BigDecimal backingAmount;
		@ApiModelProperty("已回金额")
		private BigDecimal backedAmount;
		@ApiModelProperty("已回期数")
		private String backedPeriod;
		@ApiModelProperty("总投资")
		private BigDecimal amount;
		@ApiModelProperty("总收益")
		private BigDecimal interest;
		@ApiModelProperty("总期数")
		private Integer totalPeriods;
		@ApiModelProperty("还款方式")
		private String repaymentType;
		@ApiModelProperty("是否有加息")
		private Byte haveAddInterest;
		@ApiModelProperty("回款计划")
		private List<BackPlanVO> backPlanVOList;
	}

	@ApiModel("月标投资订单详情（已结清）")
	@Data
	@ToString
	public static class MonthProjectBackedOrderDetailVO {
		@ApiModelProperty("投资金额")
		private BigDecimal amount;
		@ApiModelProperty("实际收益")
		private BigDecimal interest;
		@ApiModelProperty("总期数")
		private Integer totalPeriods;
		@ApiModelProperty("还款方式")
		private String repaymentType;
		@ApiModelProperty("是否有加息")
		private Byte haveAddInterest = Byte.valueOf("0");
		@ApiModelProperty("回款计划")
		private List<BackPlanVO> backPlanVOList;
	}

	@ApiModel("天标投资订单详情（回款中||回款逾期）")
	@Data
	@ToString
	public static class DayProjectBackingOrderDetailVO {
		@ApiModelProperty("待收金额")
		private BigDecimal backingAmount;
		@ApiModelProperty("已回金额")
		private BigDecimal backedAmount;
		@ApiModelProperty("借款天数")
		private String deadline;
		@ApiModelProperty("总投资")
		private BigDecimal amount;
		@ApiModelProperty("总收益")
		private BigDecimal interest;
		@ApiModelProperty("还款方式")
		private String repaymentType;
		@ApiModelProperty("回款日期")
		private String backDate;
		@ApiModelProperty("加息")
		private BigDecimal addInterest;
		@ApiModelProperty("收款状态(1回款中，2回款逾期，3已回款,5第三方担保机构代偿)")
		private Byte status;
	}

	@ApiModel("天标投资订单详情（已结清）")
	@Data
	@ToString
	public static class DayProjectBackedOrderDetailVO {
		@ApiModelProperty("投资金额")
		private BigDecimal amount;
		@ApiModelProperty("实际收益")
		private BigDecimal interestTotal;
		@ApiModelProperty("还款方式")
		private String repaymentType;
		@ApiModelProperty("回款日期")
		private String backDate;
		@ApiModelProperty("回款利息")
		private BigDecimal interest;
		@ApiModelProperty("回款加息")
		private BigDecimal addInterest;
		@ApiModelProperty("收款状态(1回款中，2回款逾期，3已回款,5第三方担保机构代偿)")
		private Byte status;
	}

	@Data
	@ApiModel("回款计划")
	public static class BackPlanVO {
		@ApiModelProperty("期数")
		private String period;
		@ApiModelProperty("回款时间")
		private String backDate;
		@ApiModelProperty("回款本金")
		private BigDecimal amount;
		@ApiModelProperty("回款利息")
		private BigDecimal interest;
		@ApiModelProperty("回款加息")
		private BigDecimal addInterest;
		@ApiModelProperty("收款状态(1回款中，2回款逾期，3已回款，4提前结清,5第三方担保机构代偿)")
		private Byte status;
	}
}
